package homework;

public class Check_number {
	public static void main(String[] args){
		int[] arr={1,2,3,4,5,6,7,8,9};
		System.out.println(Exit_number(4,arr));
		int[] arr2=Copy_arr(arr,2,5);
		for(int i=0;i<arr2.length;i++){
			System.out.println(arr2[i]);
		}
	}
	public static boolean Exit_number(int num,int[] arr){
		for(int i=0;i<arr.length;i++){
			if(arr[i]==num){
				return true;
			}
		}
		return false;
	}
	public static int[] Copy_arr(int[] arr,int h,int t){
		int arr2[]=new int[t-h];
		for(int j=0;j<arr2.length;j++,h++){
			arr2[j]=arr[h];
		}
		return arr2;
	}
}
